package org.example.anno;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import org.example.vaildation.StateValidation;
import java.lang.annotation.*;

@Documented
@Constraint(validatedBy = {StateValidation.class})//指定提供校验规则的类
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface State {
    //提供校验失败发布的信息
    String message() default "state参数的值只能是已发布或者草稿";
    //指定分组
    Class<?>[] groups() default {};
    //获取state附加信息
    Class<? extends Payload>[] payload() default {};
}
